package top.resty.erp.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.resty.erp.dao.IProducts;
import top.resty.erp.domain.Products;
import top.resty.erp.service.ProductService;

import java.util.List;

/**
 * <pre>
 *
 * </pre>
 *
 * @author : resty
 * @date : 2021年03月25 09:56
 */
@Service
public class ProductServiceImpl implements ProductService {
	
	@Autowired
	private IProducts iProducts;
	
	@Override
	public int saveProducts(List<Products> products) {
		return iProducts.saveProducts(products);
	}
	
	@Override
	public List<String> findAllSuppliers() {
		return iProducts.findAllSuppliers();
	}
	
	@Override
	public List<String> findAllVarieties() {
		return iProducts.findAllVarieties();
	}
	
	@Override
	public List<String> findAllContactsForSupplier(String supplier) {
		return iProducts.findAllContactsForSupplier(supplier);
	}
	
	@Override
	public List<String> findTelephonesForContact(String contact) {
		return iProducts.findTelephonesForContact(contact);
	}
	
	@Override
	public List<String> findByLikeWarehouseId(String warehouseId) {
		return iProducts.findByLikeWarehouseId(warehouseId);
	}
	
	@Override
	public List<Products> warehouseIdList(String warehouseId) {
		return iProducts.warehouseIdList(warehouseId);
	}
	
	@Override
	public boolean updateProducts(String keyStr, String valueStr, Integer id) {
		return iProducts.updateProducts(keyStr,valueStr,id)==1?true:false;
	}
	
	@Override
	public boolean deleteProducts(Integer id) {
		return iProducts.deleteProduct(id)==1?true:false;
	}
	
	@Override
	public List<Products> warehouseIdAllList(String warehouseId) {
		return iProducts.warehouseIdAllList(warehouseId);
	}
	
	
	
	
	@Override
	public List<Products> findProductsForSupplier(String supplier) {
		return iProducts.findProductsForSupplier(supplier);
	}
	
	@Override
	public List<Products> findProductsForVariety(String variety) {
		return iProducts.findProductsForVariety(variety);
	}
}
